<template>
	<div class="content">
		<div class="clear">
			<Form label-position="left" :label-width="100">
				<Input v-model="id" class="w200 m-r10" placeholder="产品编号" />
				<!--<Input v-model="title" class="w200 m-r10" placeholder="产品标题" />-->
				<Input v-model="price" class="w200 m-r10" placeholder="产品价值" />
				<!--<Input v-model="freight" class="w200 m-r10" placeholder="产品运费" />-->
				<Select placeholder="产品类型" class="w200 m-r10" v-model="query">
					<Option value="0">请选择类型</Option>
					<Option value="1">夺宝</Option>
					<Option value="2">竞猜</Option>
				</Select>
				<DatePicker :value="dataValue" type="daterange" split-panels placeholder="请选择时间段" class="w200 m-r10" format="yyyy-MM-dd" @on-change="getTime">
				</DatePicker>
				<Button type="primary" v-on:click="getConditionQuery">查询</Button>
				<Button type="primary" class="fr" @click="add">添加</Button>
			</Form>
		</div>
		<Button class="daochu" type="primary" size="large" @click="exportData" :loading="dcShow">
            <Icon type="ios-download-outline"></Icon>导出
		</Button>
		<Table stripe :columns="columns" :data="conditionQuery" ref="table" :loading="loading"></Table>
		<Page :total="info" show-elevator :page-size="pageSize" show-total @on-change="cuctGetQuery" :current.sync="page"></Page>

		<Modal v-model="Modal" :title="ModalTitle" width='40%'>
			<Form :label-width="120" :model="addForm" :rules="rules" ref="refuse">
				<FormItem label="产品类型" prop='type'>
					<!--<Select placeholder="产品类型" class="w200 m-r10" v-model="addForm.query">
						<Option value="1">夺宝</Option>
						<Option value="2">竞猜</Option>
					</Select>-->
					<Input class="w-50" v-model="addForm.query" placeholder="一币抽奖" :disabled="true" />
				</FormItem>
				<FormItem label="产品标题(中文)" prop='title'>
					<Input class="w-50" v-model="addForm.title" placeholder="请输入产品中文标题" />
				</FormItem>
				<FormItem label="产品标题(英语)" prop='title2'>
					<Input class="w-50" v-model="addForm.title2" placeholder="请输入产品英语标题" />
				</FormItem>
				<FormItem label="产品标题(越南语)" prop='title3'>
					<Input class="w-50" v-model="addForm.title3" placeholder="请输入产品越南语标题" />
				</FormItem>
				<FormItem label="产品价值" prop='price'>
					<Input class="w-50" v-model="addForm.price" placeholder="请输入产品价值" />
				</FormItem>
				<!--<FormItem label="产品详情" prop='details'>
					<Input class="w-50" v-model="addForm.details" placeholder="请输入产品详情" type="textarea" />
				</FormItem>-->
				<FormItem label="产品详情(中文)" prop="details">
					<quill-editor v-model="addForm.details" ref="myQuillEditor" :options="editorOption" @blur="onEditorBlur($event)" @focus="onEditorFocus($event)" @change="onEditorChange($event)"></quill-editor>
				</FormItem>
				<FormItem label="产品详情(英语)" prop="details2">
					<quill-editor v-model="addForm.details2" ref="myQuillEditor2" :options="editorOption2" @blur="onEditorBlur($event)" @focus="onEditorFocus($event)" @change="onEditorChange($event)"></quill-editor>
				</FormItem>
				<FormItem label="产品详情(越南语)" prop="details3">
					<quill-editor v-model="addForm.details3" ref="myQuillEditor3" :options="editorOption3" @blur="onEditorBlur($event)" @focus="onEditorFocus($event)" @change="onEditorChange($event)"></quill-editor>
				</FormItem>
				<!-- <FormItem label="产品运费" prop='freight'>
					<Input class="w-50" v-model="addForm.freight" placeholder="请输入产品运费" />
				</FormItem> -->
				<FormItem label="产品主图" prop='picture'>
					<Input class="w-50" v-model="addForm.picture" placeholder="#" type="textarea" disabled />
				</FormItem>
				<FormItem label="当前图片" v-if="imgUrl">
					<img :src="imgUrl" alt="" width="200">
				</FormItem>
				<template>
					<Upload type="drag" :action="axios.defaults.baseURL+'/upload/images/'" :headers='myHeaders' ref="upload1" :on-success='handleSuccess' name="file">
						<div style="padding: 20px 0">
							<Icon type="ios-cloud-upload" size="52" style="color: #3399ff"></Icon>
							<p>上传产品主图</p>
						</div>
					</Upload>
				</template>
				<FormItem label="产品详情图" prop='pictureDetails'>
					<Input class="w-50" v-model="addForm.pictureDetails" placeholder="#" type="textarea" />
				</FormItem>
				<template>
					<Upload multiple type="drag" :action="axios.defaults.baseURL+'/upload/images/'" :headers='myHeaders' ref="upload2" :on-success='handleSuccess2' name="file">
						<div style="padding: 20px 0">
							<Icon type="ios-cloud-upload" size="52" style="color: #3399ff"></Icon>
							<p>上传产品详情图</p>
						</div>
					</Upload>
				</template>
				<FormItem label="建议图片尺寸">
					宽：400px 高：400px
				</FormItem>
				<FormItem label="图片格式">
					jpg、gif、png
				</FormItem>
				<FormItem label="图片大小">
					不超过10mb 图片太大影响加载速度
				</FormItem>
			</Form>
			<div slot="footer">
				<Button type="text" size="large" @click="productCannel">取消</Button>
				<Button type="primary" size="large" :loading="mark" @click="product">确定</Button>
			</div>
		</Modal>

		<Modal v-model="Modal2" title="修改产品" width='40%'>
			<Form :label-width="120" :model="updateForm" :rules="rules2" ref="refuse2">
				<FormItem label="产品类型" prop='type'>
					<Select :placeholder="updateForm.query == 1 ? '夺宝' : '竞猜'" class="w200 m-r10" v-model="updateForm.query">
						<Option value="1">夺宝</Option>
						<Option value="2">竞猜</Option>
					</Select>
				</FormItem>
				<FormItem label="产品标题(中文)" prop='title'>
					<Input class="w-50" v-model="updateForm.title" placeholder="请输入产品中文标题" />
				</FormItem>
				<FormItem label="产品标题(英语)" prop='title2'>
					<Input class="w-50" v-model="updateForm.title2" placeholder="请输入产品英语标题" />
				</FormItem>
				<FormItem label="产品标题(越南语)" prop='title3'>
					<Input class="w-50" v-model="updateForm.title3" placeholder="请输入产品越南语标题" />
				</FormItem>
				<FormItem label="产品价值" prop='price'>
					<Input class="w-50" v-model="updateForm.price" placeholder="请输入产品价值" />
				</FormItem>
				<!--<FormItem label="产品详情" prop='details'>
					<Input class="w-50" v-model="updateForm.details" placeholder="请输入产品详情" type="textarea" />
				</FormItem>-->
				<FormItem label="产品详情(中文)" prop="details">
					<quill-editor v-model="updateForm.details" ref="myQuillEditor4" :options="editorOption4" @blur="onEditorBlur($event)" @focus="onEditorFocus($event)" @change="onEditorChange($event)"></quill-editor>
				</FormItem>
				<FormItem label="产品详情(英语)" prop="details2">
					<quill-editor v-model="updateForm.details2" ref="myQuillEditor5" :options="editorOption5" @blur="onEditorBlur($event)" @focus="onEditorFocus($event)" @change="onEditorChange($event)"></quill-editor>
				</FormItem>
				<FormItem label="产品详情(越南语)" prop="details3">
					<quill-editor v-model="updateForm.details3" ref="myQuillEditor6" :options="editorOption6" @blur="onEditorBlur($event)" @focus="onEditorFocus($event)" @change="onEditorChange($event)"></quill-editor>
				</FormItem>
				<FormItem label="产品主图" prop='picture'>
					<Input class="w-50" v-model="updateForm.picture" placeholder="#" type="textarea" disabled />
				</FormItem>
				<FormItem label="当前图片" v-if="imgUrl2">
					<img :src="imgUrl2" alt="" width="200">
				</FormItem>
				<template>
					<Upload type="drag" :action="axios.defaults.baseURL+'/upload/images/'" :headers='myHeaders' :on-success='handleSuccess' name="file">
						<div style="padding: 20px 0">
							<Icon type="ios-cloud-upload" size="52" style="color: #3399ff"></Icon>
							<p>上传产品主图</p>
						</div>
					</Upload>
				</template>
				<FormItem label="产品详情图" prop='pictureDetails'>
					<Input class="w-50" v-model="updateForm.pictureDetails" placeholder="#" type="textarea" />
				</FormItem>
				<template>
					<Upload multiple type="drag" :action="axios.defaults.baseURL+'/upload/images/'" :headers='myHeaders' :on-success='handleSuccess2' name="file">
						<div style="padding: 20px 0">
							<Icon type="ios-cloud-upload" size="52" style="color: #3399ff"></Icon>
							<p>上传产品详情图</p>
						</div>
					</Upload>
				</template>
				<FormItem label="建议图片尺寸">
					宽：400px 高：400px
				</FormItem>
				<FormItem label="图片格式">
					jpg、gif、png
				</FormItem>
				<FormItem label="图片大小">
					不超过10mb 图片太大影响加载速度
				</FormItem>
			</Form>
			<div slot="footer">
				<Button type="text" size="large" @click="productCannel2">取消</Button>
				<Button type="primary" size="large" @click="product2">确定</Button>
			</div>
		</Modal>
	</div>
</template>
<script>
	export default {
		data() {
			return {
				myHeaders: {
					Authorization: 'bearer ' + localStorage.getItem('mytoken')
				},
				dcShow: false,
				loading: true,
				jsonData: [],
				walletInfo: null, // 总钱包信息
				moneySummary: '', // 提币汇总
				dataValue: ['', ''], // 时间段值
				query: '0',
				addForm: {
					query: '',
					title: '',
					title2: '',
					title3: '',
					price: '',
					details: '',
					details2: '',
					details3: '',
					picture: '',
					pictureDetails: '',
				},
				updateForm: {
					query: '',
					title: '',
					title2: '',
					title3: '',
					price: '',
					details: '',
					details2: '',
					details3: '',
					picture: '',
					pictureDetails: '',
				},
				rules: {
					title: [{
						required: true,
						message: '请输入产品中文标题',
						trigger: 'blur'
					}],
					title2: [{
						required: true,
						message: '请输入产品英语标题',
						trigger: 'blur'
					}],
					title3: [{
						required: true,
						message: '请输入产品越南语标题',
						trigger: 'blur'
					}],
					price: [{
						required: true,
						message: '请输入产品价值',
						trigger: 'blur'
					}],
				},
				rules2: {
					title: [{
						required: true,
						message: '请输入产品中文标题',
						trigger: 'blur'
					}],
					title2: [{
						required: true,
						message: '请输入产品英语标题',
						trigger: 'blur'
					}],
					title3: [{
						required: true,
						message: '请输入产品越南语标题',
						trigger: 'blur'
					}],
					price: [{
						required: true,
						message: '请输入产品价值',
						trigger: 'blur'
					}],
				},
				editorOption: {},
				editorOption2: {},
				editorOption3: {},
				editorOption4: {},
				editorOption5: {},
				editorOption6: {},
				Modal: false,
				Modal2: false,
				ModalTitle: '添加产品',
				conditionQuery: [], // 条件查询的结果
				info: null, // 总条数
				page: 1, // 页数
				pageSize: 20, // 每页多少条
				current: 1,
				model: false,
				modal2: false,
				loading: true,
				modelIndex: '', // 审核成功时候需要用到的 ID
				value: '', // 审核失败的时候填入的值
				downList: [],
				detailList: [],
				imgUrl: '',
				imgUrl2: '',
				id: '',
				title: '',
				price: '',
				freight: '',
				mark:false,// 标记
				columns: [{
						title: '产品编号',
						key: 'id',
						align: 'center',
						render: (h, params) => {
							return h('div', params.row.id == null ? '#' : params.row.id)
						}
					},
					{
						title: '产品主图',
						key: 'picture',
						render: (h, params) => {
							return h('div', [
								h('img', {
									attrs: {
										src: params.row.picture,
										preview: params.row.createTime
									},
									style: {
										width: '70px',
										margin: '10px 0'
									}
								})
							])
						}
					},
					{
						title: '产品详情图',
						key: 'pictureDetails',
						render: (h, params) => {
							let src = params.row.pictureDetails.split(';');
							return h('div', src.map(function(item, index) {
								return h('img', {
									attrs: {
										src: item,
										preview: params.row.id
									},
									style: {
										width: '70px',
										margin: '10px 0',
										display: index == 0 ? '' : 'none'
									}
								})
							}))
						}
					},
					{
						title: '产品中文标题',
						key: 'cnTitle',
						align: 'center',
						render: (h, params) => {
							return h('div', params.row.cnTitle == null ? '#' : params.row.cnTitle)
						}
					},
					{
						title: '产品英语标题',
						key: 'usTitle',
						align: 'center',
						render: (h, params) => {
							return h('div', params.row.usTitle == null ? '#' : params.row.usTitle)
						}
					},
					{
						title: '产品越南语标题',
						key: 'vnTitle',
						align: 'center',
						render: (h, params) => {
							return h('div', params.row.vnTitle == null ? '#' : params.row.vnTitle)
						}
					},
					{
						title: '产品价值',
						key: 'price',
						align: 'center',
						render: (h, params) => {
							return h('div', params.row.price == null ? '#' : params.row.price)
						}
					},
					// {
					//   title: '产品运费',
					//   key: 'freight',
					//   align: 'center',
					//   render: (h, params) => {
					//     return h('div', params.row.freight == null ? '#' : params.row.freight)
					//   }
					// },
					{
						title: '产品类型',
						key: 'type',
						align: 'center',
						render: (h, params) => {
							return h('div', params.row.type == 1 ? '夺宝' : '竞猜')
						}
					},
					{
						title: '添加时间',
						key: 'createTime',
						align: 'center',
						sortable: true,
						render: (h, params) => {
							return h('div', params.row.createTime == null ? '#' : this.stringToTime(params.row.createTime))
						}
					},
					{
						title: '操作',
						key: 'action',
						width: 200,
						align: 'center',
						render: (h, params) => {
							return h('div', [
								h(
									'Button', {
										props: {
											type: 'primary',
											size: 'small'
										},
										style: {
											marginRight: '5px'
										},
										on: {
											click: () => {
												params.row.price = String(params.row.price);
												this.edit(params.row);
											}
										}
									},
									'修改'
								),
								h(
									'Button', {
										props: {
											type: 'error',
											size: 'small'
										},
										on: {
											click: () => {
												let $this = this
												this.$Modal.confirm({
													title: '删除产品',
													content: '是否要删除该产品？',
													onOk: function() {
														$this.remove($this.conditionQuery[params.index].id)
													}
												})
											}
										}
									},
									'删除'
								)
							])
						}
					}
				]
			}
		},
		mounted() {
			this.$Message.config({ // 配置弹窗的位置
				top: 250
			})
			this.getQuery() // 产品列表查询
		},
		methods: {
			getQuery() { // 产品列表查询
				this.loading = true
				let params = this.qs.stringify({
					current: this.page, // 当前页【可选，默认1】
					size: this.pageSize, // 每页记录数【可选，默认20】
					title: '',
					price: '',
					freight: '',
					id: '',
					type: this.query,
					startTime: this.dataValue[0] == '' ? '' : this.dataValue[0], // 起始日期
					endTime: this.dataValue[1] == '' ? '' : this.dataValue[1] // 结束日期
				})
				this.axios.post('product/select', params).then(res => {
					if(res.data.code == 200) {
						this.conditionQuery = res.data.data.records;
						this.info = res.data.data.total;
						this.loading = false;
					}
				})
			},
			cuctGetQuery(page) { // 产品列表分页查询
				this.loading = true
				let params = this.qs.stringify({
					current: page, // 当前页【可选，默认1】
					size: this.pageSize, // 每页记录数【可选，默认20】
					title: '',
					price: '',
					freight: '',
					id: '',
					type: this.query,
					// startTime: this.dataValue[0] == '' ? '' : this.dataValue[0], // 起始日期
					// endTime: this.dataValue[1] == '' ? '' : this.dataValue[1] // 结束日期
					startTime: this.dataValue[0] == '' ? '' : this.dataValue[0] + ' 00:00:01', // 起始日期,
					endTime: this.dataValue[1] == '' ? '' : this.dataValue[1] + ' 23:59:59', // 结束日期,
				})
				this.axios.post('product/select', params).then(res => {
					if(res.data.code == 200) {
						this.conditionQuery = res.data.data.records;
						this.info = res.data.data.total;
						this.loading = false;
					}
				})
			},
			getConditionQuery() { // 产品列表条件查询
				this.page = 1
				this.loading = true
				let params = this.qs.stringify({
					current: this.page, // 当前页【可选，默认1】
					size: this.pageSize, // 每页记录数【可选，默认20】
					title: this.title,
					price: this.price,
					freight: this.freight,
					id: this.id,
					type: this.query,
					// startTime: (this.dataValue[0] == '' || this.dataValue[0] == undefined) ? '' : this.dataValue[0], // 起始日期
					// endTime: (this.dataValue[1] == '' || this.dataValue[1] == undefined) ? '' : this.dataValue[1] // 结束日期
					startTime: this.dataValue[0] == '' ? '' : this.dataValue[0] + ' 00:00:01', // 起始日期,
					endTime: this.dataValue[1] == '' ? '' : this.dataValue[1] + ' 23:59:59', // 结束日期,
				})
				this.axios.post('product/select', params).then(res => {
					if(res.data.code == 200) {
						this.conditionQuery = res.data.data.records;
						this.info = res.data.data.total;
						this.loading = false;
					}
				})
			},
			add() { // 添加商品
				this.imgUrl = '';
				this.$refs['refuse'].resetFields();
				this.Modal = true;
				this.mark = false;
				this.$refs.upload1.clearFiles()
				this.$refs.upload2.clearFiles()
			},
			productCannel() { // 取消添加商品
				this.Modal = false;
			},
			productCannel2() { // 取消修改商品
				this.Modal2 = false;
			},
			edit(params) {
				// 复制选择修改的页面的数据
				this.Modal2 = true;
				this.updateForm.id = params.id;
				this.updateForm.query = params.type;
				this.updateForm.picture = params.picture;
				this.updateForm.pictureDetails = params.pictureDetails;
				this.updateForm.title = params.cnTitle;
				this.updateForm.title2 = params.usTitle;
				this.updateForm.title3 = params.vnTitle;
				this.updateForm.price = params.price;
				this.updateForm.freight = params.freight;
				this.updateForm.details = params.cnDetails;
				this.updateForm.details2 = params.usDetails;
				this.updateForm.details3 = params.vnDetails;
			},
			product() { // 确认添加商品
				if(!this.imgUrl) {
					this.$Message.info('产品主图不能为空！');
					return false;
				}
				if(!this.addForm.pictureDetails) {
					this.$Message.info('产品主图不能为空！');
					return false;
				}
				this.$refs.refuse.validate(valid => {
					if(valid) {
						let token = localStorage.getItem('mytoken')
						let params = this.qs.stringify({
							picture: this.addForm.picture,
							pictureDetails: this.addForm.pictureDetails,
							price: this.addForm.price,
							type: 1,
							cnTitle: this.addForm.title,
							usTitle: this.addForm.title2,
							vnTitle: this.addForm.title3,
							cnDetails: this.addForm.details,
							usDetails: this.addForm.details2,
							vnDetails: this.addForm.details3,
						})
						if (!this.mark) {
							this.mark = true;
							this.axios.post('product/add', params).then(res => {
							if(res.data.code == 200) {
								// 添加商品成功后的处理
								this.Modal = false;
								
								this.getQuery(); // 产品列表查询
							}
							this.$Message.info(res.data.msg);
							 setTimeout(() => {
								this.mark = false;
							}, 1000);
						})
						}
						
					}
				})
			},
			product2() { // 确认修改商品
				if(!this.updateForm.query) {
					this.$Message.info('产品类型不能为空！');
					return false;
				}
				if(!this.updateForm.picture) {
					this.$Message.info('产品主图不能为空！');
					return false;
				}
				if(!this.updateForm.pictureDetails) {
					this.$Message.info('产品详情图不能为空！');
					return false;
				}
				this.$refs.refuse2.validate(valid => {
					if(valid) {
						let token = localStorage.getItem('mytoken')
						let params = this.qs.stringify({
							id: this.updateForm.id,
							picture: this.updateForm.picture,
							pictureDetails: this.updateForm.pictureDetails,
							price: this.updateForm.price,
							type: this.updateForm.query,
							cnTitle: this.updateForm.title,
							usTitle: this.updateForm.title2,
							vnTitle: this.updateForm.title3,
							cnDetails: this.updateForm.details,
							usDetails: this.updateForm.details2,
							vnDetails: this.updateForm.details3,
						})
						this.axios.post('product/update', params).then(res => {
							if(res.data.code == 200) {
								// 添加商品成功后的处理
								this.Modal2 = false;
								this.getQuery(); // 产品列表查询
							}
							this.$Message.info(res.data.msg);
						})
					}
				})
			},
			exportData() { // 导出
				this.dcShow = true
				this.axios.post('product/select', this.qs.stringify({
					current: this.page, // 当前页【可选，默认1】
					size: this.pageSize, // 每页记录数【可选，默认20】
					title: this.title,
					price: this.price,
					freight: this.freight,
					id: this.id,
					type: this.query,
					// startTime: this.dataValue[0] == '' ? '' : this.dataValue[0], // 起始日期
					// endTime: this.dataValue[1] == '' ? '' : this.dataValue[1] // 结束日期
					startTime: this.dataValue[0] == '' ? '' : this.dataValue[0] + ' 00:00:01', // 起始日期,
					endTime: this.dataValue[1] == '' ? '' : this.dataValue[1] + ' 23:59:59', // 结束日期,
				})).then(res => {
					if(res.data.code == 200) {
						this.axios.post('product/select', this.qs.stringify({
							current: 1, // 当前页【可选，默认1】
							size: res.data.data.total, // 每页记录数【可选，默认20】
							title: this.title,
							price: this.price,
							freight: this.freight,
							id: this.id,
							type: this.query,
							// startTime: this.dataValue[0] == '' ? '' : this.dataValue[0], // 起始日期
							// endTime: this.dataValue[1] == '' ? '' : this.dataValue[1] // 结束日期
							startTime: this.dataValue[0] == '' ? '' : this.dataValue[0] + ' 00:00:01', // 起始日期,
							endTime: this.dataValue[1] == '' ? '' : this.dataValue[1] + ' 23:59:59', // 结束日期,
						})).then(res => {
							if(res.data.code == 200) {
								this.downList = res.data.data.records
								this.downList.forEach((row, index) => {
									this.jsonData.push({
										id: this.downList[index].id,
										picture: this.downList[index].picture,
										pictureDetails: this.downList[index].pictureDetails,
										cnTitle: this.downList[index].cnTitle,
										usTitle: this.downList[index].usTitle,
										vnTitle: this.downList[index].vnTitle,
										price: this.downList[index].price,
										// freight: this.downList[index].freight,
										type: this.downList[index].type == 1 ? '夺宝' : '竞猜',
										createTime: this.stringToTime(this.downList[index].createTime)
									})
								})
								let str = `产品编号,产品主图,	产品详情图,产品中文标题,产品英语标题,产品越南语标题,产品价值,产品类型,添加时间\n`;
								this.downLoad(this.jsonData, str, '产品管理列表');
							}
						})
					}
				})
			},
			remove(id) {
				let params = this.qs.stringify({
					id: id
				})
				this.axios.post('product/delete', params).then(res => {
					if(res.data.code == 200) {
						this.getQuery();
					}
					this.$Message.info(res.data.msg);
				})
			},
			getTime(daterange) { // 处理时间段时间格式
				this.dataValue = daterange;
			},
			handleSuccess(res, file) {
				this.$Message.info(res.msg);
				this.imgUrl = res.data[0].url;
				this.imgUrl2 = res.data[0].url;
				this.addForm.picture = this.imgUrl; // 添加产品主图
				this.updateForm.picture = this.imgUrl2; // 修改产品主图
			},
			handleSuccess2(res, file) {
				this.$Message.info(res.msg);
				this.addForm.pictureDetails == '' ? '' : this.addForm.pictureDetails += ';';
				this.updateForm.pictureDetails == '' ? '' : this.updateForm.pictureDetails += ';';
				this.addForm.pictureDetails += res.data[0].url; // 添加产品主图
				this.updateForm.pictureDetails += res.data[0].url; // 修改产品主图
			},
			Fixed(count) {
				count += '';
				let rs = count.indexOf('.');
				if(rs < 0) {
					return count + '.00';
				}
				while(count.length <= rs + 2) {
					count += '0';
				}
				return count.substr(0, rs + 3);
			},
			// 富文本编辑器
			onEditorBlur() {
				// 失去焦点事件
			},
			onEditorFocus() {
				// 获得焦点事件
			},
			onEditorChange() {
				// 内容改变事件
			},
		}
	}
</script>